package day07;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class TestThree {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        List<String> li = new ArrayList<>();
        System.out.println("输入单词数量：");
        boolean flag = false;
        while (!flag) {
            int n;
            n = sc.nextInt();
            System.out.println("输入" + n + "个单词：");
            if (n >= 20) {
                System.out.println("输入的英文单词不能超过20个，请重新输入");
            } else {
                for (int i = 0; i < n; i++) {
                    String word = sc.next();
                    li.add(word);
                }
                Collections.sort(li);
                for (String s : li)
                    System.out.print(s + '\t');
                flag = true;
            }
        }
    }
}

